<?php

namespace liketp\response;

use liketp\Response;

class Json extends Response
{
    protected $contentType = 'application/json';

    public function output($data)
    {
        if ($data instanceof \Closure) {
            $data = $data();
        }
        return json_encode($data);
    }
}
